#ifndef VEC3_H
#define VEC3_H

/*!
  \class Vec3
  \brief Stores a 3D point or vector

  This a simple class for storing x, y, z. There are also useful nu

  Example:
  \code
    Vec3 point1; // Initilizes 0.0, 0.0, 0.0
    Vec3 point2(1.0) //Inits to 1.0, 1.0, 1.0
    Vec3 point3(1.0, 2.0, 3.0) //Inits to 1.0, 2.0, 3.0

    Now you can do math on the vec
    Vec3 point4 = point2 + point3; //point4 = 2.0, 3.0, 4.0
    Vec3 point5 = point1 * 5.0; //point5 = 5.0, 5.0, 5.0

    //Component wise multiple
    Vec3 point6 = point5 * point4 //point6 = 10.0, 15.0, 20.0

    //Using x, y, z
    double valueX = point6.x;
    double valueY = point6.y;
    double valueZ = point6.z;

    Vec3 point7;
    point7.x = point6.x * point2.x;
    point7.y = point6.y * point3.y;
    point7.z = point6.z * point4.z;
    //Point 7 is now 10.0, 30.0, 60.0

  \endcode

  */

class Vec3 {
public:
    //Data
    double x, y, z;

    //Initilizers
    Vec3();
    Vec3(double init);
    Vec3(double x, double y, double z);
    Vec3(const Vec3& copyVec);

    //Assignment
    Vec3 operator=(const Vec3& copyVec);

    //Math operators
    Vec3 operator*(double value) const;
    Vec3 operator*(const Vec3& vec) const;
    Vec3 operator/(double value) const;
    Vec3 operator/(const Vec3& vec) const;
    Vec3 operator+(const Vec3& vec) const;
    Vec3 operator-(const Vec3& vec) const;

    //Useful vector operation
    double Length() const;
    Vec3 Normalize() const;

    protected:
    //Copy helper function to the assignment and copy constructor
    void Copy(const Vec3 vec);
};

#endif // VEC3_H
